<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.blog.service.MenuTree"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="com.blog.domain.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	MenuTree menuMsg = (MenuTree) request.getSession().getAttribute(
			"menuTree");
	User usr = (User) request.getSession().getAttribute("user");
	request.setCharacterEncoding("UTF-8");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>树上的小屋</title>
<link href="<%=basePath%>/css/style.css" type="text/css"
	rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<%=basePath%>/ui/menu/menu.css" />
<link rel="stylesheet" type="text/css" media="all" href="<%=basePath%>/ui/easyui/themes/default/easyui.css"/>
<script type="text/javascript" src="<%=basePath%>ui/menu/menu.js"></script>
<script language="javascript" type="text/javascript" src="<%=basePath%>/ui/easyui/jquery.easyui.min.js"></script>
<script language="javascript" type="text/javascript" src="<%=basePath%>/ui/easyui/jquery-1.4.4.min.js"></script>
<style type="text/css">
#letter{position:absolute;top:-50px;font-size:9pt;font-weight:bold;}
</style>	
<script>
    var url;
	function gotopage(murl){
	var rootpath='<%=basePath%>';	
	url = rootpath + murl;
	window.location.href = url;	
	}
	$(document).onload(function(){
	makesnake();
	});

var follow_mouse=false;
var mouse_x,mouse_y;
var message="cloris的博客，欢迎大家多踩踩~";
message=message.split("");
var xpos=new Array();
for(var i=0;i<message.length;i++) xpos[i]=-50;
var ypos=new Array();
for(i=0;i<message.length-1;i++) ypos[i]=-50;
var letter_spacing=20;
function onMouseMove()
{
mouse_x=document.body.scrollLeft+event.clientX
mouse_y=document.body.scrollTop+event.clientY
follow_mouse=true;
}
function makesnake()
{
if(follow_mouse)
{
for(var i=message.length-1;i>=1;i--)
{
xpos[i]=xpos[i-1]+letter_spacing;
ypos[i]=ypos[i-1];
}
xpos[0]=mouse_x+letter_spacing;
ypos[0]=mouse_y;
for(i=0;i<message.length;i++)
{
letter[i].style.posLeft=xpos[i];
letter[i].style.posTop=ypos[i];
}
}
var timer=setTimeout("makesnake()",30);
}
for(i=0;i<message.length;i++)
{
document.write('<span id="letter">'+message[i]+'</span>');
}
document.onmousemove=onMouseMove;

</script>
</head>

<body style="background-image:url(<%=basePath%>/img/backGroud.jpg)" onload ="makesnake()">
	<div id="container">
		<div id="banner">
			<h1>CLORISの树上小屋</h1>
			<br />
			<h2>勇气 + 毅力 + 信心</h2>
			<div>
				欢迎您,
				<%
				if (usr != null) {
					out.print(usr.getUserName());
				} else {
					out.print("亲爱的访客");
				}
			%>～～
			</div>
		</div>
		<div>
			<div>
				<%
					out.print(menuMsg.getMainTreeView());
				%>
			</div>
<div>
<% String message=(String)request.getAttribute("msg");
   if(message!=null){
	   out.print("<font color='red'>"+message+"</font>");
   }
%>
</div>